package com.example.test;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by lsl on 2021/2/25.
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@Entity(name = "jpa_user_address")
@org.hibernate.annotations.Table(appliesTo = "jpa_user_address", comment = "jpa 测试项目用户地址表")
public class UserAddress {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false)
    private Long userId;

    @Column(nullable = false)
    private String address;

    @Column(columnDefinition = "timestamp comment '创建时间'")
    private Date createDate;

    @Column(columnDefinition = "TIMESTAMP NULL DEFAULT NULL COMMENT '更新时间1'")
    private Date updateDate;

    @ColumnDefault(value = "0")
    private Byte deleted;

    private Integer version;
}
